home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 June
/
EnigmA AMIGA RUN 19 (1997)(G.R. Edizioni)(IT)[!][issue 1997-06][EAR-CD III].iso
/
imagestudio
/
imagestudio68000
/
rexx
/
demo.isrx
< prev
next >
Wrap
Text File
|
1995-03-16
|
7KB
|
222 lines
/* ImageStudio ARexx script **************************************/
/* Allow commands to return results */
options results
/* On error, goto ERROR:. Comment out this line if you wish to */
/* perform your own error checking. */
signal on error
/* BEGIN PROGRAM *************************************************/
SQ = "'"
REQUEST_MESSAGE TEXT '"Welcome to ImageStudio!\n\n'||,
'This script will show some of features\n'||,
'of the program; if you wish to stop the\n'||,
'script at any time, just press Cancel."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_MESSAGE TEXT '"ImageStudio'SQ's ARexx interface has\n'||,
'been designed to be easy to use and\n'||,
'includes many built in facilities to\n'||,
'simplify the writing of scripts. One\n'||,
'example of this is the number of\n'||,
'different requester types available.\n'||,
'This requester is a REQUEST_MESSAGE\n'||,
'requester, the following is a\n'||,
'REQUEST_FILE requester..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_FILE
REQUEST_MESSAGE TEXT '"You chose:\n\n'||RESULT||'\n\n'||,
'Batch processing requires the choosing\n'||,
'of multilple files, for this we use the\n'||,
'REQUEST_MULTIFILE requester..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_MULTIFILE STEM multifileinfo.
REQUEST_MESSAGE TEXT '"You chose '||multifileinfo.files.count||' files.\n\n'||,
'Directories can be chosen with the\n'||,
'REQUEST_DIR requester..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_DIR
REQUEST_MESSAGE TEXT '"You chose:\n\n'||RESULT||'\n\n'||,
'ImageStudio also has a built in screen\n'||,
'mode requester for choosing modes, sizes,\n'||,
'depths and overscan details of screens.\n'||,
'Here is the REQUEST_SCREENMODE requester..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_SCREENMODE GADSENABLED STEM screenmodeinfo.
REQUEST_MESSAGE TEXT '"You chose:\n\n'||screenmodeinfo.text||'\n\n'||,
'In order to obtain differing types\n'||,
'of information from the user, further\n'||,
'requesters are given. Here is the simple\n'||,
'REQUEST_STRING requester..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_STRING TEXT2 '"Enter your name:"' VAR username
REQUEST_MESSAGE TEXT '"Hello '||username||'\n\n'||,
'The REQUEST_MESSAGE requester is very\n'||,
'flexible and can be used for simple\n'||,
'multiple choice selections..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_MESSAGE TEXT '"Are you male or female '||username||'?"',
BUTTONTEXT "Male|Female|Cancel" AUTOCANCEL VAR usersex
if usersex == 1 then
usersexdesc = 'bloke.'
else
usersexdesc = 'girl.'
REQUEST_MESSAGE TEXT '"'||username||' is a good name for a '||,
usersexdesc||'\n\n'||,
'More complex multiple choices are made\n'||,
'with the REQUEST_LIST requester. For\n'||,
'example, select your computer..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_LIST TITLE '"Choose your computer..."' STRINGS,
'"Amiga 500"' '"Amiga 600"' '"Amiga 1000"' '"Amiga 1200"',
'"Amiga 1500"' '"Amiga 2000"' '"Amiga 3000"' '"Amiga 4000"',
'"CD32"' '"None of the above"'
REQUEST_MESSAGE TEXT '"Good to hear it.\n\n'||,
'To change multiple values at one time\n'||,
'the REQUEST_MULTIVALUE requester is\n'||,
'used. This works in a similar manner\n'||,
'to the Prefs requester, enter details\n'||,
'about your computer..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_MULTIVALUE TITLE '"Enter computer details..."' STRINGS,
'"Processor"' 68030,
'"Memory"' '"10MBytes"',
'"Hard drive"' '"550MBytes"',
'"Monitor"' '"14in multiscan"',
'"Printer"' '"Epson 9-pin"'
REQUEST_MESSAGE '"OK, OK, OK, enough requesters!\n\n'||,
'ImageStudio can do all of the operations\n'||,
'available from the GUI. For example,\n'||,
'select an image..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_FILE VAR filename
OPEN '"'filename'"'
BALANCE BRIGHTNESS 50
REQUEST_MESSAGE '"The image is a bit brighter now, right?"',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
EFFECT NAME '"FlipY"'
REQUEST_MESSAGE TEXT '"Effects, colour balance and\n'||,
'convolution filters can all be applied\n'||,
'through ARexx. As can scaling, colour\n'||,
'reduction, loading and saving - in fact\n'||,
'the only thing you can'SQ't do is alter\n'||,
'the GUI i.e. you can'SQ't move, open or\n'||,
'close windows from ARexx. Yet."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_MESSAGE TEXT '"ARexx also allows you access to\n'||,
'powerful features not available through\n'||,
'the GUI. One example of this is file\n'||,
'notification which will inform the\n'||,
'current script when a file is changed in\n'||,
'a current directory. For example, select\n'||,
'OK then copy any file into the Ram Disk..."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
NOTIFY_DIR PATHPART "ram:" STEM notifyinfo.
SCREEN_FRONT
REQUEST_MESSAGE TEXT '"You copied:\n\n'notifyinfo.filepart'\n\n'||,
'This could be useful if you wish\n'||,
'to start processing when a certain\n'||,
'file is created."',
BUTTONTEXT "OK|Cancel" AUTOCANCEL
REQUEST_MESSAGE TEXT '"Thanks for following this demo\n'||,
'and we hope you'SQ'll enjoy using the\n'||,
'new power available through ARexx.\n'||,
'Feel free to look at the source code\n'||,
'of this demo and of the example\n'||,
'scripts to learn further how ARexx\n'||,
'can be used to work for you."'
/* END PROGRAM ***************************************************/
exit
/* On ERROR */
ERROR:
/* If we get here, either an error occurred with the command's */
/* execution or there was an error with the command itself. */
/* In the former case, rc2 contains the error message and in */
/* the latter, rc2 contains an error number. SIGL contains */
/* the line number of the command which caused the jump */
/* to ERROR: */
if datatype(rc2,'NUMERIC') == 1 then do
/* See if we can describe the error with a string */
select
when rc2 == 103 then
err_string = "ERROR 103, "||,
"out of memory at line "||SIGL
when rc2 == 114 then
err_string = "ERROR 114, "||,
"bad command template at line "||SIGL
when rc2 == 115 then
err_string = "ERROR 115, "||,
"bad number for /N argument at line "||SIGL
when rc2 == 116 then
err_string = "ERROR 116, "||,
"required argument missing at line "||SIGL
when rc2 == 117 then
err_string = "ERROR 117, "||,
"value after keywork missing at line "||SIGL
when rc2 == 118 then
err_string = "ERROR 118, "||,
"wrong number of arguments at line "||SIGL
when rc2 == 119 then
err_string = "ERROR 119, "||,
"unmatched quotes at line "||SIGL
when rc2 == 120 then
err_string = "ERROR 120, "||,
"line too long at line "||SIGL
when rc2 == 236 then
err_string = "ERROR 236, "||,
"unknown command at line "||SIGL
otherwise
err_string = "ERROR "||rc2||", at line "||SIGL
end
end
else if rc2 == 'RC2' then do
err_string = "ERROR in command at line "||SIGL
end
else do
err_string = rc2||", line "||SIGL
end
request_message TEXT '"'err_string'"'
exit